package com.zbj.homemade.mybatis.conf;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @program: principle
 * @description:  简易mybatis 单数据源
 * @author: Yinn
 * @create: 2019-01-11 15:40
 **/
public class Configuration {

    private String url;

    private String username;

    private String password;

    private String driver;

    //存储xml文件信息
    private Map<String,MappedStatement> mappers = new ConcurrentHashMap<>();

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Map<String, MappedStatement> getMappers() {
        return mappers;
    }

    public void setMappers(Map<String, MappedStatement> mappers) {
        this.mappers = mappers;
    }

    public  MappedStatement getMappedStatement(String statement) {
        return mappers.get(statement);
    }

    public  MappedStatement putMappedStatement(String statement,MappedStatement mappedStatement) {
        return mappers.put(statement,mappedStatement);
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }
}
